<?php
namespace app\home\model\system;

use basic\BaseModel;
use traits\ModelTrait;

/**
 * 积分套餐
 * Class SystemPoint
 * @package app\home\model\system
 */
class SystemPoint extends BaseModel
{
    /**
     * 主键
     * @var string
     */
    protected $pk = "id";

    /**
     * 模型
     * @var string
     */
    protected $name = "system_point";

    use ModelTrait;

    /**
     * 分頁
     * @param $where
     * @return array
     */
    public static function systemPage($where)
    {
        $model = new self();
        if ($where['is_show'] != '') $model = $model->where('is_show', $where['is_show']);
        if ($where['title'] != '') $model = $model->where('title', 'LIKE', "%$where[title]%");
        $model = $model->where('is_del', 0);
        $model = $model->where('wxapp_id', self::$wxapp_id);
        $model = $model->order('sort desc,id desc');
        return self::page($model, $where);
    }
}